package com.mr.userclient.utils;

/**
 * Class: MathUtil
 * User (作者):MRui
 * TODO (描述)：判断两个Double类型数值是否相等
 * Date 2018.09.26 23:36
 */
public class MathUtil {

    private static final Double MONEY_RANGE = 0.01;

    /**
    * User (作者): MRui
    * TODO (描述)：比较两个金额是否相等
    * Data：2018.09.26 23:37
    */
    public static Boolean equals(Double d1,Double d2){
        Double result = Math.abs(d1 - d2);
        if (result < MONEY_RANGE){
            return true;
        }else {
            return false;
        }
    }
}
